package com;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class ConnectionFactory {
	
	private static SqlSessionFactory sqlSessionFactory;
	private static Reader reader;
	private static InputStream inputStream;
	static{	
		try{
			inputStream =  Resources.getResourceAsStream("config.xml");
			sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}	
	}
	
	public static SqlSessionFactory getSession()
	{
		return sqlSessionFactory;
	}


}
